// 
// Author: jiangli
// Email: 1316762810@qq.com
//
#pragma once

#include <iosfwd>
#include <string>

/**
 * @file message.hpp
 **/
/**
 * @class Message
 * @brief Forwards string to screen
 * @author jiangli
 * @date 2024
 **/
class Message {
public:
  /**
   * @brief Constructor from a string
   * @param[in] m a message
   **/
  Message(const std::string &m) : message_(m) {}
  
  /**
   * @brief Constructor from a character array
   * @param[in] m a message
   **/
  Message(const char *m) : message_(std::string(m)) {}

  friend std::ostream &operator<<(std::ostream &os, Message &obj) {
    return obj.PrintObject(os);
  }

private:
  // The message to be forwarded to screen
  std::string message_;

  /**
   * @brief Function to forward message to screen
   * @param[in, out] os output stream
   **/
  std::ostream &PrintObject(std::ostream &os);
};